package com.bwie.common;


public class ServiceMessage<T> {

	private int status;
	private String message;
	private T date;
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public T getDate() {
		return date;
	}
	public void setDate(T date) {
		this.date = date;
	}
	public ServiceMessage(int status, String message, T date) {
		super();
		this.status = status;
		this.message = message;
		this.date = date;
	}
	public ServiceMessage() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Override
	public String toString() {
		return "ServiceMessage [status=" + status + ", message=" + message + ", date=" + date + "]";
	}
	
	public static <T> ServiceMessage<T> Ok(){
		return ServiceMessage.ok(null);
	}
	public static <T> ServiceMessage<T> ok(T data) {
		// TODO Auto-generated method stub
		return new ServiceMessage<T>(200,"ok",data);
	}
	public static <T> ServiceMessage<T> error(){
		return new ServiceMessage<T>(500,"error",null);
	}
	
}
